package com.qianfeng.test.utils;

import com.nostra13.universalimageloader.core.DisplayImageOptions;

/**
 * Created by Administrator on 15-7-24.
 */
public class ImageLoaderHelper {
    private static ImageLoaderHelper helper;


    private ImageLoaderHelper() {
    }


    public static ImageLoaderHelper getInstance() {
        if (helper == null) {
            helper = new ImageLoaderHelper();
        }
        return helper;
    }


    public DisplayImageOptions getDisplayImageOptions(int resFailId, int resLoadingId) {
        DisplayImageOptions.Builder builder = new DisplayImageOptions.Builder();

        builder.cacheInMemory(true);
        builder.cacheOnDisk(true);
        builder.showImageOnLoading(resLoadingId);
        builder.showImageOnFail(resFailId);
        return builder.build();
    }

}

